//
//  DYAddBranchShopCell.m
//  kafuMerchant
//
//  Created by 帝云科技 on 2018/9/18.
//  Copyright © 2018年 帝云科技. All rights reserved.
//

#import "DYAddBranchShopCell.h"

@interface DYAddBranchShopCell ()


@end


@implementation DYAddBranchShopCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)dy_initUI
{
    [super dy_initUI];
    
    self.sideMargin=BILIWIDTH(10);
    [self xhq_noneSelectionStyle];
    
    self.titleLabel=({
        UILabel *label=[Utils labelWithTitleFontSize:12 textColor:[UIColor xhq_content] alignment:0];
        label;
    });
    
    self.textField = ({
        UITextField *text=[[UITextField alloc]init];
        text.font=kFont(14);
        [text setValue:[UIColor xhq_assist] forKeyPath:@"_placeholderLabel.textColor"];
        text.autocorrectionType = UITextAutocorrectionTypeNo;
        text;
    });
    
    self.arrowImageView = ({
        UIImageView *imageView=[Utils imageViewWithImage:IMG(@"icon_select")];
        imageView;
    });
    
    [self addSubview:self.titleLabel];
    [self addSubview:self.textField];
    [self addSubview:self.arrowImageView];
    self.arrowImageView.hidden=YES;
    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(BILIWIDTH(10));
        make.top.equalTo(BILIHEIGHT(10));
    }];
    
    [self.textField makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self);
        make.height.equalTo(BILIHEIGHT(30));
        make.left.equalTo(BILIWIDTH(10));
        make.right.equalTo(BILIWIDTH(-10));
    }];
    
    [self.arrowImageView makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(BILIWIDTH(-10));
        make.centerY.equalTo(self);
    }];
    
    [self.textField addTarget:self action:@selector(textFieldDidChange:) forControlEvents:UIControlEventEditingChanged];
}
-(void)textFieldDidChange:(UITextField *)textField
{
    !self.textFieldBlock?:self.textFieldBlock(textField.text);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
